﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// 销售退货基础输入参数
/// </summary>
public class SalesreturnsBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 退货单号
    /// </summary>
    public virtual string? ReturnOrderNumber { get; set; }
    
    /// <summary>
    /// 单据状态
    /// </summary>
    public virtual int? DocumentStatus { get; set; }
    
    /// <summary>
    /// 退货日期
    /// </summary>
    public virtual DateTime? ReturnDate { get; set; }
    
    /// <summary>
    /// 销售单号
    /// </summary>
    public virtual string? BillNumber { get; set; }
    
    /// <summary>
    /// 客户名称
    /// </summary>
    public virtual long? ClientNameId { get; set; }
    
    /// <summary>
    /// 联系人
    /// </summary>
    public virtual string? Contact { get; set; }
    
    /// <summary>
    /// 联系方式
    /// </summary>
    public virtual string? Contacts { get; set; }
    
    /// <summary>
    /// 销售部门
    /// </summary>
    public virtual long? SalesDepartmentId { get; set; }
    
    /// <summary>
    /// 销售负责人
    /// </summary>
    public virtual string? HeadOfSales { get; set; }
    
    /// <summary>
    /// 退货数量
    /// </summary>
    public virtual int? NumberOfReturns { get; set; }
    
    /// <summary>
    /// 退货金额
    /// </summary>
    public virtual decimal? ReturnMoney { get; set; }
    
    /// <summary>
    /// 退货货品
    /// </summary>
    public virtual string? ReturnedItems { get; set; }
    
    /// <summary>
    /// 制单人
    /// </summary>
    public virtual string? MakeASingle { get; set; }
    
    /// <summary>
    /// 所在部门
    /// </summary>
    public virtual long? DepartmentId { get; set; }
    
    /// <summary>
    /// 制单时间
    /// </summary>
    public virtual DateTime? MakeASingleDate { get; set; }
    
    /// <summary>
    /// 审核人
    /// </summary>
    public virtual string? Reviewers { get; set; }
    
    /// <summary>
    /// 审核时间
    /// </summary>
    public virtual DateTime? ReviewTime { get; set; }
    
}

/// <summary>
/// 销售退货分页查询输入参数
/// </summary>
public class PageSalesreturnsInput : BasePageInput
{
    /// <summary>
    /// 退货单号
    /// </summary>
    public string? ReturnOrderNumber { get; set; }
    
    /// <summary>
    /// 单据状态
    /// </summary>
    public int? DocumentStatus { get; set; }
    
    /// <summary>
    /// 退货日期范围
    /// </summary>
     public DateTime?[] ReturnDateRange { get; set; }
    
    /// <summary>
    /// 销售单号
    /// </summary>
    public string? BillNumber { get; set; }
    
    /// <summary>
    /// 客户名称
    /// </summary>
    public long? ClientNameId { get; set; }
    
    /// <summary>
    /// 联系人
    /// </summary>
    public string? Contact { get; set; }
    
    /// <summary>
    /// 联系方式
    /// </summary>
    public string? Contacts { get; set; }
    
    /// <summary>
    /// 销售部门
    /// </summary>
    public long? SalesDepartmentId { get; set; }
    
    /// <summary>
    /// 销售负责人
    /// </summary>
    public string? HeadOfSales { get; set; }
    
    /// <summary>
    /// 退货数量
    /// </summary>
    public int? NumberOfReturns { get; set; }
    
    /// <summary>
    /// 退货金额
    /// </summary>
    public decimal? ReturnMoney { get; set; }
    
    /// <summary>
    /// 退货货品
    /// </summary>
    public string? ReturnedItems { get; set; }
    
    /// <summary>
    /// 制单人
    /// </summary>
    public string? MakeASingle { get; set; }
    
    /// <summary>
    /// 所在部门
    /// </summary>
    public long? DepartmentId { get; set; }
    
    /// <summary>
    /// 制单时间范围
    /// </summary>
     public DateTime?[] MakeASingleDateRange { get; set; }
    
    /// <summary>
    /// 审核人
    /// </summary>
    public string? Reviewers { get; set; }
    
    /// <summary>
    /// 审核时间范围
    /// </summary>
     public DateTime?[] ReviewTimeRange { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 销售退货增加输入参数
/// </summary>
public class AddSalesreturnsInput
{
    /// <summary>
    /// 退货单号
    /// </summary>
    [MaxLength(32, ErrorMessage = "退货单号字符长度不能超过32")]
    public string? ReturnOrderNumber { get; set; }
    
    /// <summary>
    /// 单据状态
    /// </summary>
    public int? DocumentStatus { get; set; }
    
    /// <summary>
    /// 退货日期
    /// </summary>
    public DateTime? ReturnDate { get; set; }
    
    /// <summary>
    /// 销售单号
    /// </summary>
    [MaxLength(32, ErrorMessage = "销售单号字符长度不能超过32")]
    public string? BillNumber { get; set; }
    
    /// <summary>
    /// 客户名称
    /// </summary>
    public long? ClientNameId { get; set; }
    
    /// <summary>
    /// 联系人
    /// </summary>
    [MaxLength(32, ErrorMessage = "联系人字符长度不能超过32")]
    public string? Contact { get; set; }
    
    /// <summary>
    /// 联系方式
    /// </summary>
    [MaxLength(32, ErrorMessage = "联系方式字符长度不能超过32")]
    public string? Contacts { get; set; }
    
    /// <summary>
    /// 销售部门
    /// </summary>
    public long? SalesDepartmentId { get; set; }
    
    /// <summary>
    /// 销售负责人
    /// </summary>
    [MaxLength(32, ErrorMessage = "销售负责人字符长度不能超过32")]
    public string? HeadOfSales { get; set; }
    
    /// <summary>
    /// 退货数量
    /// </summary>
    public int? NumberOfReturns { get; set; }
    
    /// <summary>
    /// 退货金额
    /// </summary>
    public decimal? ReturnMoney { get; set; }
    
    /// <summary>
    /// 退货货品
    /// </summary>
    [MaxLength(32, ErrorMessage = "退货货品字符长度不能超过32")]
    public string? ReturnedItems { get; set; }
    
    /// <summary>
    /// 制单人
    /// </summary>
    [MaxLength(32, ErrorMessage = "制单人字符长度不能超过32")]
    public string? MakeASingle { get; set; }
    
    /// <summary>
    /// 所在部门
    /// </summary>
    public long? DepartmentId { get; set; }
    
    /// <summary>
    /// 制单时间
    /// </summary>
    public DateTime? MakeASingleDate { get; set; }
    
    /// <summary>
    /// 审核人
    /// </summary>
    [MaxLength(32, ErrorMessage = "审核人字符长度不能超过32")]
    public string? Reviewers { get; set; }
    
    /// <summary>
    /// 审核时间
    /// </summary>
    public DateTime? ReviewTime { get; set; }
    
}

/// <summary>
/// 销售退货删除输入参数
/// </summary>
public class DeleteSalesreturnsInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 销售退货更新输入参数
/// </summary>
public class UpdateSalesreturnsInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 退货单号
    /// </summary>    
    [MaxLength(32, ErrorMessage = "退货单号字符长度不能超过32")]
    public string? ReturnOrderNumber { get; set; }
    
    /// <summary>
    /// 单据状态
    /// </summary>    
    public int? DocumentStatus { get; set; }
    
    /// <summary>
    /// 退货日期
    /// </summary>    
    public DateTime? ReturnDate { get; set; }
    
    /// <summary>
    /// 销售单号
    /// </summary>    
    [MaxLength(32, ErrorMessage = "销售单号字符长度不能超过32")]
    public string? BillNumber { get; set; }
    
    /// <summary>
    /// 客户名称
    /// </summary>    
    public long? ClientNameId { get; set; }
    
    /// <summary>
    /// 联系人
    /// </summary>    
    [MaxLength(32, ErrorMessage = "联系人字符长度不能超过32")]
    public string? Contact { get; set; }
    
    /// <summary>
    /// 联系方式
    /// </summary>    
    [MaxLength(32, ErrorMessage = "联系方式字符长度不能超过32")]
    public string? Contacts { get; set; }
    
    /// <summary>
    /// 销售部门
    /// </summary>    
    public long? SalesDepartmentId { get; set; }
    
    /// <summary>
    /// 销售负责人
    /// </summary>    
    [MaxLength(32, ErrorMessage = "销售负责人字符长度不能超过32")]
    public string? HeadOfSales { get; set; }
    
    /// <summary>
    /// 退货数量
    /// </summary>    
    public int? NumberOfReturns { get; set; }
    
    /// <summary>
    /// 退货金额
    /// </summary>    
    public decimal? ReturnMoney { get; set; }
    
    /// <summary>
    /// 退货货品
    /// </summary>    
    [MaxLength(32, ErrorMessage = "退货货品字符长度不能超过32")]
    public string? ReturnedItems { get; set; }
    
    /// <summary>
    /// 制单人
    /// </summary>    
    [MaxLength(32, ErrorMessage = "制单人字符长度不能超过32")]
    public string? MakeASingle { get; set; }
    
    /// <summary>
    /// 所在部门
    /// </summary>    
    public long? DepartmentId { get; set; }
    
    /// <summary>
    /// 制单时间
    /// </summary>    
    public DateTime? MakeASingleDate { get; set; }
    
    /// <summary>
    /// 审核人
    /// </summary>    
    [MaxLength(32, ErrorMessage = "审核人字符长度不能超过32")]
    public string? Reviewers { get; set; }
    
    /// <summary>
    /// 审核时间
    /// </summary>    
    public DateTime? ReviewTime { get; set; }
    
}

/// <summary>
/// 销售退货主键查询输入参数
/// </summary>
public class QueryByIdSalesreturnsInput : DeleteSalesreturnsInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataSalesreturnsInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 销售退货数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportSalesreturnsInput : BaseImportInput
{
    /// <summary>
    /// 退货单号
    /// </summary>
    [ImporterHeader(Name = "退货单号")]
    [ExporterHeader("退货单号", Format = "", Width = 25, IsBold = true)]
    public string? ReturnOrderNumber { get; set; }
    
    /// <summary>
    /// 单据状态
    /// </summary>
    [ImporterHeader(Name = "单据状态")]
    [ExporterHeader("单据状态", Format = "", Width = 25, IsBold = true)]
    public int? DocumentStatus { get; set; }
    
    /// <summary>
    /// 退货日期
    /// </summary>
    [ImporterHeader(Name = "退货日期")]
    [ExporterHeader("退货日期", Format = "", Width = 25, IsBold = true)]
    public DateTime? ReturnDate { get; set; }
    
    /// <summary>
    /// 销售单号
    /// </summary>
    [ImporterHeader(Name = "销售单号")]
    [ExporterHeader("销售单号", Format = "", Width = 25, IsBold = true)]
    public string? BillNumber { get; set; }
    
    /// <summary>
    /// 客户名称 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? ClientNameId { get; set; }
    
    /// <summary>
    /// 客户名称 文本
    /// </summary>
    [ImporterHeader(Name = "客户名称")]
    [ExporterHeader("客户名称", Format = "", Width = 25, IsBold = true)]
    public string ClientNameFkDisplayName { get; set; }
    
    /// <summary>
    /// 联系人
    /// </summary>
    [ImporterHeader(Name = "联系人")]
    [ExporterHeader("联系人", Format = "", Width = 25, IsBold = true)]
    public string? Contact { get; set; }
    
    /// <summary>
    /// 联系方式
    /// </summary>
    [ImporterHeader(Name = "联系方式")]
    [ExporterHeader("联系方式", Format = "", Width = 25, IsBold = true)]
    public string? Contacts { get; set; }
    
    /// <summary>
    /// 销售部门 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? SalesDepartmentId { get; set; }
    
    /// <summary>
    /// 销售部门 文本
    /// </summary>
    [ImporterHeader(Name = "销售部门")]
    [ExporterHeader("销售部门", Format = "", Width = 25, IsBold = true)]
    public string SalesDepartmentFkDisplayName { get; set; }
    
    /// <summary>
    /// 销售负责人
    /// </summary>
    [ImporterHeader(Name = "销售负责人")]
    [ExporterHeader("销售负责人", Format = "", Width = 25, IsBold = true)]
    public string? HeadOfSales { get; set; }
    
    /// <summary>
    /// 退货数量
    /// </summary>
    [ImporterHeader(Name = "退货数量")]
    [ExporterHeader("退货数量", Format = "", Width = 25, IsBold = true)]
    public int? NumberOfReturns { get; set; }
    
    /// <summary>
    /// 退货金额
    /// </summary>
    [ImporterHeader(Name = "退货金额")]
    [ExporterHeader("退货金额", Format = "", Width = 25, IsBold = true)]
    public decimal? ReturnMoney { get; set; }
    
    /// <summary>
    /// 退货货品
    /// </summary>
    [ImporterHeader(Name = "退货货品")]
    [ExporterHeader("退货货品", Format = "", Width = 25, IsBold = true)]
    public string? ReturnedItems { get; set; }
    
    /// <summary>
    /// 制单人
    /// </summary>
    [ImporterHeader(Name = "制单人")]
    [ExporterHeader("制单人", Format = "", Width = 25, IsBold = true)]
    public string? MakeASingle { get; set; }
    
    /// <summary>
    /// 所在部门 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? DepartmentId { get; set; }
    
    /// <summary>
    /// 所在部门 文本
    /// </summary>
    [ImporterHeader(Name = "所在部门")]
    [ExporterHeader("所在部门", Format = "", Width = 25, IsBold = true)]
    public string DepartmentFkDisplayName { get; set; }
    
    /// <summary>
    /// 制单时间
    /// </summary>
    [ImporterHeader(Name = "制单时间")]
    [ExporterHeader("制单时间", Format = "", Width = 25, IsBold = true)]
    public DateTime? MakeASingleDate { get; set; }
    
    /// <summary>
    /// 审核人
    /// </summary>
    [ImporterHeader(Name = "审核人")]
    [ExporterHeader("审核人", Format = "", Width = 25, IsBold = true)]
    public string? Reviewers { get; set; }
    
    /// <summary>
    /// 审核时间
    /// </summary>
    [ImporterHeader(Name = "审核时间")]
    [ExporterHeader("审核时间", Format = "", Width = 25, IsBold = true)]
    public DateTime? ReviewTime { get; set; }
    
}
